package com;

public class factorial {
	private int n;

	public int getN() {
		return n;
	}

	public void setN(int n) {
		this.n = n;
	}
	
	public void fa() {
		int sum1 = 1;
		int sum2 = 0;
		for(int i=1;i<=n;i++) {
			sum1 *= i;
			sum2 += sum1;
		}
		System.out.println(sum2);
	}
	
}
